package pri.hillchen.std.concurren.chapter7.util;

import java.util.concurrent.Callable;
import java.util.concurrent.RunnableFuture;

/**
 * @author:hillchen
 * @DESCRIPTION:可取消任务
 * @Date: Created in 14:59 2018/2/9 0009.
 */
public interface CancellableTask<T> extends Callable<T> {
    /**
     * 取消任务
     */
    void cancell();

    /**
     * 创建FutureTask一笔外部通过该Task来取消任务
     * @return
     */
    RunnableFuture<T> newTask();
}
